package com.rpc.app;

import com.dubbo.rpc.RpcClient;
import com.rpc.app.service.IAppService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;


@SpringBootApplication(scanBasePackages = { "com.rpc.app", "com.dubbo.rpc" })
public class AppClientApplication {

    @Resource
    private RpcClient rpcClient;

    @PostConstruct
    public void init() {
        IAppService appService = rpcClient.create(IAppService.class);

        String result = appService.info("xyz");
        System.err.println(result);
    }


    public static void main(String[] args) {
        SpringApplication.run(AppClientApplication.class, args);
    }

}